" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.
UseVimball
finish
ftplugin/c/drcstubs.vim	[[[1
346
" drcstubs.vim: Dr Chip's C Stubs  (a plugin)
"   isk is set to include # so as not to break #if
"
"  Author:  Charles E. Campbell
"  Date:    Jun 19, 2010
"  Version: 4a
"
" ---------------------------------------------------------------------
"  Usage:  (requires 6.0 or later) {{{1
"
"   These maps all work during insert mode while editing a C
"   or C++ program.  Use either the shorthand or longhand maps
"   below, and the associated construct will be expanded to
"   include parentheses, curly braces, and the cursor will be
"   moved to a convenient location, still in insert mode, for
"   further editing.
"
"   Shorthand  Longhand
"   Map        Map
"   ---------  --------
"   i`         if`
"   e`         els[e]`
"   ei`        eli[f]`
"   er`
"   f`         for`
"   w`         wh[ile]`
"   s`         sw[itch]`
"   c`         ca[se]`
"   d`         defa[ult]`
"              do`
"              in[clude]` yields #include
"              de[fine]`  yields #define
"   E`         Ed[bg]`    (see http://mysite.verizon.net/astronaut/dbg)
"   R`         Rd[bg]`    (see http://mysite.verizon.net/astronaut/dbg)
"   D`         Dp[rintf]` (see http://mysite.verizon.net/astronaut/dbg)
"   #`                    #ifdef ... #endif
"   ?`         ? "" : "null "
"
"   Caveat: these maps will not work if "set paste" is on
"
" ---------------------------------------------------------------------
" Installation: {{{2
"
" This copy of DrC's C-Stubs is filetype plugin for vim 6.0: put it in
"  ${HOME}/.vim/ftplugin/c/    -and-   ${HOME}/.vim/ftplugin/cpp/
" (or make suitable links) and put "filetype plugin on" in your <.vimrc>.
"
" "For I am convinced that neither death nor life, neither angels nor demons,
"  neither the present nor the future, nor any powers, nor height nor depth,
"  nor anything else in all creation, will be able to separate us from the
"  love of God that is in Christ Jesus our Lord."  Rom 8:38
" =======================================================================
" Load Once: {{{1
if exists("b:loaded_drcstubs")
  finish
endif
let b:loaded_drcstubs= "v4a"
let b:undo_ftplugin  ="let &isk=@,48-57,_"

" ---------------------------------------------------------------------
" Special Syntax: {{{1
syn keyword cTodo COMBAK
syn match cTodo "^[- ]*COMBAK[- ]*$" 
setlocal isk+=#
setlocal isk-=:
"DechoTabOn

" =====================================================================
" Public Interface: {{{1

" backquote calls DrChipCStubs function
if !hasmapto('<Plug>UseDrCStubs')
 imap <buffer> <unique> ` <Plug>UseDrCStubs
endif
inoremap <Plug>UseDrCStubs <Esc>:call <SID>DrChipCStubs()<CR>a

" provide help for drcstubs
com! Drcstubs call s:CMapHlp()

if has("gui") && has("gui_running") && !exists("s:did_drcstubs_menu")
 let s:did_drcstubs_menu= 1
 menu DrChip.DrCStubs.Help	:Drcstubs<cr>
 imenu DrChip.DrCStubs.if	if`
 imenu DrChip.DrCStubs.else	e`
 imenu DrChip.DrCStubs.elseif	ei`
 imenu DrChip.DrCStubs.for	f`
 imenu DrChip.DrCStubs.while	w`
 imenu DrChip.DrCStubs.switch	s`
 imenu DrChip.DrCStubs.case	c`
 imenu DrChip.DrCStubs.default	d`
 imenu DrChip.DrCStubs.do	do`
 imenu DrChip.DrCStubs.include	in`
 imenu DrChip.DrCStubs.define	de`
 imenu DrChip.DrCStubs.Edbg	E`
 imenu DrChip.DrCStubs.Rdbg	R`
 imenu DrChip.DrCStubs.Dprintf	D`
 imenu DrChip.DrCStubs.ifdef	#`
 imenu DrChip.DrCStubs.?\.\.	?`
endif

" =====================================================================
" Functions: {{{1

" ---------------------------------------------------------------------
" DrChipCStubs: this function changes the backquote into {{{2
"               text based on what the preceding word was
fun! s:DrChipCStubs()
"  call Dfunc("DrChipCStubs()")
  let vekeep= &ve
  set ve=
 
  let wrd= expand("<cWORD>")
  if wrd != '^#$'
   let wrd= expand("<cword>")
  endif
  let chr= substitute(getline("."),'^.*\%'.col('.').'c\(.\).*$','\1','')
  if strlen(chr) > 1
   let chr   = substitute(wrd,'^.*\(.\)$','\1','')
  endif
  let inline= (virtcol("$") - virtcol(".")) > 1
"  call Decho("wrd<".wrd."> chr<".chr."> inline=".inline)

  if chr =~ '^\\'
   norm! r`

  elseif chr =~ '?'
"   call Decho('chr=~?')
   if inline
    exe 'norm! xi? "" : "null ",'
   else
    exe 'norm! xa? "" : "null ",'
   endif

  elseif     wrd =~ '\<if\>'
"   call Decho('\<if')
   exe "norm! bdWaif() {\<CR>}\<Esc>k$F("
   ino <esc> <esc>f{:iun <c-v><esc><cr>o
  elseif wrd =~ '\<i\>'
"   call Decho('\<i')
   exe "norm! xaif() {\<CR>}\<Esc>k$F("
   ino <esc> <esc>f{:iun <c-v><esc><cr>o
 
  elseif wrd =~ '\<els\%[e]\>'
   exe "norm! bdWaelse {\<CR>}\<Esc>O \<c-h>\<Esc>"
"   call Decho('\<els')
  elseif wrd =~ '\<e\>'
   exe "norm! xaelse {\<CR>}\<Esc>O \<c-h>\<Esc>"
"   call Decho('\<e')
 
  elseif wrd =~ 'eli\%[f]\>'
   exe "norm! bdWaelse if() {\<CR>}\<Esc>k$F("
   ino <esc> <esc>f{:iun <c-v><esc><cr>o
"   call Decho('\<eli')
  elseif wrd =~ '\<ei\>'
   exe "norm! bdWaelse if() {\<CR>}\<Esc>k$F("
   ino <esc> <esc>f{:iun <c-v><esc><cr>o
"   call Decho('\<ei')
 
  elseif wrd =~ 'fo\%[r]\>'
   call drcstubs#DrCStubMulti("sil! norm! bdWafor(;;) {\<cr>}\<esc>",
	  \ 'k$F(l',
	  \ 'f;l',
	  \ 'f;l',
	  \ "jYP$D")
"   call Decho('\<for')
  elseif wrd =~ '\<f\>'
   call drcstubs#DrCStubMulti("sil! norm! bdWafor(;;) {\<cr>}\<esc>",
	  \ 'k$F(l',
	  \ 'f;l',
	  \ 'f;l',
	  \ "jYP$D")
"   call Decho('\<f\>')
 
  elseif wrd =~ 'wh\%[ile]\>'
   call drcstubs#DrCStubMulti("sil! norm! bdWawhile() {\<cr>",
	  \ 'k$F(',
	  \ "jYP$D")
"   call Decho('\<wh')
  elseif wrd =~ '\<w\>'
   call drcstubs#DrCStubMulti("sil! norm! bdWawhile() {\<cr>",
	  \ 'k$F(',
	  \ "jYP$D")
"   call Decho('\<w\>')
 
  elseif wrd =~ 'sw\%[itch]\>'
   exe "norm! bdWaswitch() {\<CR>}\<Esc>k$F("
   ino <esc> <esc>f{:iun <c-v><esc><cr>o
"   call Decho('\<sw')
  elseif wrd =~ '\<s\>'
   exe "norm! xaswitch() {\<CR>}\<Esc>k$F("
   ino <esc> <esc>f{:iun <c-v><esc><cr>o
"   call Decho('\<s')
 
  elseif wrd =~ 'ca\%[se]\>'
   exe "norm! bdWacase 1:\<CR>break;\<Esc>khf:hxh"
   ino <esc> <esc>$a/* %%% */<esc>:s/case \zs\(.*:\)\s*\/\* %%%/\1 \/* \1/<cr>:iun <c-v><esc><cr>o
"   call Decho('\<ca')
  elseif wrd =~ '\<c\>'
   exe "norm! xacase 1:\<CR>break;\<Esc>khf:hxh"
   ino <esc> <esc>$a/* %%% */<esc>:s/case \zs\(.*:\)\s*\/\* %%%/\1 \/* \1/<cr>:iun <c-v><esc><cr>o
"   call Decho('\<c')
 
  elseif wrd =~ 'de\%[fault]\>'
   exe "norm! bdWadefault:\<CR>break;\<Esc>O \<c-h>\<Esc>"
"   call Decho('\<de')
  elseif wrd =~ '\<d\>'
   exe "norm! xadefault:\<CR>break;\<Esc>O \<c-h>\<Esc>"
"   call Decho('\<d\>')
 
  elseif wrd =~ '\<do\>'
   call drcstubs#DrCStubMulti("norm! bdWado {\<CR>} while();\<Esc>O \<Esc>$",
	  \ "?while(\<cr>0f(l",
	  \ "?do {\<cr>j$")
"   call Decho('\<do')

  elseif wrd =~ 'er\%[r]\|xm\%[err]'
   exe 'norm! bdWaif(xmerror)(*xmerror)(XTDIO_WARNING,"(X)\n");'."\<esc>FXcw"
   ino <esc> <esc>:iun <c-v><esc><cr>f)a 
 
  elseif wrd =~ 'Ed\%[bg]\>'
   exe "norm! bdWaEdbg((\"\<Esc>ma[[?)\<CR>%BdwP`apa()\"));\<Esc>F("
   ino <esc> <esc>:iun <c-v><esc><cr>/"));$<cr>li
"   call Decho('\<Ed')
  elseif wrd =~ '\<E\>'
   exe "norm! xaEdbg((\"\<Esc>ma[[?)\<CR>%BdwP`apa()\"));\<Esc>F("
   ino <esc> <esc>:iun <c-v><esc><cr>/"));$<cr>li
"   call Decho('\<E')
 
  elseif wrd =~ 'Rd\%[bg]\>'
   exe "norm! bdWaRdbg((\"\<Esc>ma[[?)\<CR>%BdwP`apa\"));\<Esc>F\"h"
   ino <esc> <esc>:iun <c-v><esc><cr>/"));$<cr>l
"   call Decho('\<Rd')
  elseif wrd =~ '\<R\>'
   exe "norm! xaRdbg((\"\<Esc>ma[[?)\<CR>%BdwP`apa\"));\<Esc>F\"h"
   ino <esc> <esc>:iun <c-v><esc><cr>/"));$<cr>l
"   call Decho('\<R')
 
  elseif wrd =~ 'Dp\%[rintf]\>'
   exe "norm! bdWaDprintf((1,\"\"));\<Esc>4h"
   ino <esc> <esc>:iun <c-v><esc><cr>/"));$<cr>l
"   call Decho('\<Dp')
  elseif wrd =~ '\<D\>'
   exe "norm! xaDprintf((1,\"\"));\<Esc>4h"
   ino <esc> <esc>:iun <c-v><esc><cr>/"));$<cr>l
"   call Decho('\<D')
  
  elseif wrd =~ 'in\%[clude]\>'
   exe "norm! bdW0i#include \<Esc>"
"   call Decho('\<in')

  elseif wrd =~ 'de\%[fine]\>'
   exe "norm! bdW0i#define \<Esc>"
"   call Decho('\<de')
 
  elseif wrd =~ '#'
   exe "norm! 0Di#ifdef \<cr>#endif\<esc>kA"
"   call Decho('#')
 
  else
   exe "norm! a`\<Esc>"
  endif
 
  let &ve= vekeep

"  call Dret("DrChipCStubs")
endfun

" ---------------------------------------------------------------------
" CMapHlp: sets up a special window holding a list of my C-related {{{2
" maps, imaps, etc
fun! s:CMapHlp()
"  call Dfunc("CMapHlp()")

  " create DrC's C Stubs window
  if !exists("s:c_helpbuf") || !bufexists(s:c_helpbuf)
   let isfkeep= &isfname
   set isfname-=[
   set isfname-=]
   exe "bo sp ".escape("[DrC's C Stubs]"," '[]")
   set buftype=nofile
   set bufhidden=wipe
   set noswapfile
   set noro
   let &isfname   = isfkeep
   let s:c_helpbuf = bufnr("%")
  endif

  put ='_               Imaps_'
  put ='_Longhand     Shorthand 	Expands To_'
  put =' --------     --------- 	----------'
  put ='  if           i        	 if(X) {\|Y\|}'
  put ='  els[e]       e        	 else {\|X\|}'
  put ='  eli[f]       ei       	 else if(X) {\|Y\|}'
  put ='  fo[r]        f        	 for(X;Y;Z) {\|W\|}'
  put ='  wh[ile]      w        	 while(X) {\|Y\|}'
  put ='  sw[itch]     s        	 switch(X) {\|Y\|}'
  put ='  ca[se]       c        	 case X:\|Y\|break;'
  put ='  defa[ult]    d        	 default:\|Y\|break;'
  put ='  do                    	 do {\|X\|} while(Y);'
  put ='  Ed[bg]       E        	 Edbg((\"func(X)\",Y));'
  put ='  Rd[bg]       R        	 Rdbg((\"func X\",Y));'
  put ='  Dp[rintf]    D        	 Dprintf((1,\"X\",Y));'
  put ='  in[clude]             	 #include X'
  put ='  de[fine]              	 #define X'
  put ='  #                     	 #ifdef X ... #endif'
  put =' '
  put ='	 \|=carriage return  X,Y,Z,W=successive cursor placements'

  " syntax highlighting
  syn match CmapBar		'---\+'
  syn match CmapInfo	'([^)]\+)'		contains=CmapParen
  syn match CmapTitle	'^.*{{{\d$'		contains=CmapIgnore
  syn match CmapTitle	'_.\{-}_'		contains=CmapIgnore
  syn match CmapIgnore	'{{{\d'			contained
  syn match CmapIgnore	'_'				contained
  syn match CmapParen	'[{}()]'		contained
  syn match CmapExpansion '\t .*$'		contains=CmapKeys,CmapParen,CmapCursor,CmapNewline
  syn match CmapCursor	'\<[XYZW]\>'	contained
  syn match CmapNewline '|'				contained
  syn case match
  syn keyword CmapKeys	contained if else for while switch case default do Edbg Rdbg Dprintf #include #define #ifdef #endif DDmatout DDvecout DCmatout DCvecout

  if !exists("b:did_drcstubs_help")
   command -nargs=+ HiLink hi def link <args>
   HiLink CmapBar 		Delimiter
   HiLink CmapIgnore	Ignore
   HiLink CmapInfo		String
   HiLink CmapNewline	Delimiter
   HiLink CmapParen		Delimiter
   HiLink CmapTitle		Statement
   HiLink CmapKeys		Statement
   HiLink CmapCursor	Special
   let b:did_drcstubs_help= 1
   delc HiLink
  endif

  norm! 1Gdd
  setlocal ro
  setlocal fdm=marker
  norm! zM
"  call Dret("CMapHlp")
endfun

" =====================================================================
" Modelines: {{{1
"  vim: fdm=marker
ftplugin/sh/drcstubs.vim	[[[1
256
" drcstubs.vim: Dr Chip's Sh Stubs  (a plugin)
"
"  Author:  Charles E. Campbell, Jr. (PhD)
"  Date:    Nov 04, 2009
"  Version: 3
"
"  Usage:  (requires 6.0 or later)
"
"   These maps all work during insert mode while editing vim
"   scripts.  Use either the shorthand or longhand maps
"   below, and the associated construct will be expanded to
"   include parentheses, curly braces, and the cursor will be
"   moved to a convenient location, still in insert mode, for
"   further editing.
"
"   Shorthand  Longhand
"   Map        Map
"   ---------  --------
"   c`         c[ase]`
"   i`         if`
"   e`         els[e]`
"   ei`        eli[f]`
"   fo`        for`
"   fu`        fu[nction]`
"   w`         wh[ile]`
"
"   Caveat: these maps will not work if "set paste" is on
"
"   After a line with [[...]], a line matching "^\s*($"
"   (ie. enter a "(" on an otherwise blank line)
"   will toggle between "[[..]]" and "((...))" on the line above.
"   Furthermore, a \( on such a line will become simply a "(",
"   so one can still enter a line beginning with an open parenthesis.
"
" Installation:
"
" This copy of DrC's Sh-Stubs is a ftplugin for vim 6.0: put it in
"  ${HOME}/.vim/ftplugin/sh/
" (or make suitable links) and have "filetype plugin on" in your <.vimrc>.
"
" "Blessed is the man who endures temptation, for when he has
"  been approved, he will receive the crown of life, which the Lord
"  promised to those who love him." James 1:12
"
" =======================================================================

" Load Once: {{{1
if exists("b:loaded_drcstubs")
  finish
endif
let b:loaded_drcstubs= "v3"

" ---------------------------------------------------------------------
" Special Syntax: {{{1
syn keyword	vimTodo COMBAK
syn match	vimTodo "^[- ]*COMBAK[- ]*$" 

" ---------------------------------------------------------------------
" Public Interface: {{{1

" backquote calls DrChipShStubs function
if !hasmapto('<Plug>UseDrCStubs')
 imap <buffer> <unique> ` <Plug>UseDrCShStubs
endif
inoremap <Plug>UseDrCShStubs <Esc>:call <SID>DrCShStubs()<CR>a
inoremap <buffer> <silent> (	(<c-o>:call <sid>DrCShParenChk()<cr>

" provide help for drcstubs
com! Drcstubs call s:ShMapHlp()

" ---------------------------------------------------------------------
" DrCShStubs: this function changes the backquote into {{{1
"             text based on what the preceding word was
fun! <SID>DrCShStubs()
 let vekeep= &ve
 set ve=

 let wrd=expand("<cWORD>")

 if     wrd =~ '\<ca\%[se]'
  exe "norm! bdWacase X in\<CR>esac\<Esc>k$FXxh"
  ino <esc> <esc>:iun <c-v><esc><cr>o
 elseif wrd =~ '\<c\>'
  exe "norm! xacase X in\<CR>esac\<Esc>k$FXxh"
  ino <esc> <esc>:iun <c-v><esc><cr>o

 elseif wrd =~ '\<fo\%[r]\>'
  exe "norm! bdWafor X in  ; do\<cr>done\<esc>k$FXxh"
"  ino <esc> <esc>:iun <c-v><esc><cr>0f;hha
  ino <silent> <esc> <esc>:call <sid>DrCShFor()<cr>0f;hha
 elseif wrd =~ '\<f\>'
  exe "norm! xafor X in  ; do\<cr>done\<esc>k$FXxh"
  ino <esc> <esc>:call <sid>DrCShFor()<cr>0f;hha

 elseif wrd =~ '\<if\>'
  exe "norm! bdWaif [[ X ]]; then\<CR>fi\<Esc>k$FXxh"
  ino <esc> <esc>:iun <c-v><esc><cr>o
 elseif wrd =~ '\<i\>'
  exe "norm! xaif [[ X ]]; then\<CR>fi\<Esc>k$FXxh"
  ino <esc> <esc>:iun <c-v><esc><cr>o

 elseif wrd =~ '\<els\%[e]\>'
  exe "norm! bdWaelse\<cr>	\<esc>hx"
 elseif wrd =~ '\<e\>'
  exe "norm! xaelse\<cr>	\<esc>hx"

 elseif wrd =~ '\<eli\%[f]\>'
  exe "norm! bdWaelif [[ X ]]; then\<Esc>$FXxh"
  ino <esc> <esc>:iun <c-v><esc><cr>o
 elseif wrd =~ '\<ei\>'
  exe "norm! bdWaelif [[ X ]]; then\<Esc>$FXxh"
  ino <esc> <esc>:iun <c-v><esc><cr>o

 elseif wrd =~ '\<fu\%[nction]\>'
  exe "norm! bdWafunction X\<cr>{\<cr>}\<esc>kk0fXxa"
  ino <esc> <esc>0j:iun <c-v><esc><cr>o

 elseif wrd =~ '\<wh\%[ile]\>'
  exe "norm! bdWawhile [[ X ]]; do\<CR>done\<Esc>k$FXxh"
  ino <esc> <esc>0:iun <c-v><esc><cr>o
 elseif wrd =~ '\<w\>'
  exe "norm! xawhile [[ X ]]; do\<CR>done\<Esc>k$FXxh"
  ino <esc> <esc>0:iun <c-v><esc><cr>o

 else
  exe "norm! a`\<Esc>"
 endif

 let &ve= vekeep
endfun

" ---------------------------------------------------------------------
"  DrCShParenChk:
fun! s:DrCShParenChk()
  let curline= line(".")
  let prvline= curline - 1
  if getline(curline) =~ '^\s*($' && getline(prvline) =~ '\[\[.\{-}]]'
   exe prvline.'s/\[\[/((/e'
   exe prvline.'s/]]/))/e'
   norm! j$xa
  elseif getline(curline) =~ '^\s*($' && getline(prvline) =~ '((.\{-}))'
   exe prvline.'s/((/[[/e'
   exe prvline.'s/))/]]/e'
   norm! j$xa
  elseif getline(curline) =~ '^\s*\\($'
   norm! hhxl
  endif
endfun

" ---------------------------------------------------------------------
" DrCShFor: {{{2
fun! s:DrCShFor()
  ino <esc> <esc>:iun <c-v><esc><cr>o
endfun

" ---------------------------------------------------------------------
" ShMapHlp: sets up a special window holding a list of my Sh-related {{{1
" maps, imaps, etc
fun! s:ShMapHlp()
"  call Dfunc("ShMapHlp()")

  " create DrC's Sh Stubs window
  if !exists("s:sh_helpbuf") || !bufexists(s:sh_helpbuf)
   let isfkeep= &isfname
   set isfname-=[
   set isfname-=]
   exe "bo sp ".escape("[DrC's Sh Stubs]"," '[]")
   set buftype=nofile
   set bufhidden=wipe
   set noswapfile
   set noro
   let &isfname     = isfkeep
   let s:sh_helpbuf = bufnr("%")
  endif

  put ='_               Imaps_'
  put ='_Longhand     Shorthand 	Expands To_'
  put =' --------     --------- 	----------'
  put ='  ca[se]`      c`       	 case X in\|Y\|esac'
  put ='  fo[r]`       f`       	 for X in Y ; do\|Z\|done'
  put ='  if`          i`       	 if [[ X ]]; then\|Y\|fi'
  put ='  eli[f]`      ei`      	 elif [[ X ]]; then\|Y'
  put ='  els[e]`      e`       	 else\|X'
  put ='  fu[nction]`           	 function X\|{\|Y\|}'
  put ='  wh[ile]`     w`       	 while [[ X ]]; do\|Y\|done'
  put =' '
  put ='	 \|=carriage return  X,Y,Z=successive cursor placements'

  " syntax highlighting
  syn match SHmapBar		'---\+'
  syn match SHmapInfo	'([^)]\+)'	contains=SHmapParen
  syn match SHmapTitle	'^.*{{{\d$'	contains=SHmapIgnore
  syn match SHmapTitle	'_.\{-}_'	contains=SHmapIgnore
  syn match SHmapIgnore	'{{{\d'		contained
  syn match SHmapIgnore	'_'			contained
  syn match SHmapParen	'[()]'		contained
  syn match SHmapExpansion '\t .*$'	contains=SHmapKeys,SHmapParen,SHmapCursor,SHmapNewline
  syn match SHmapCursor	'\<[XYZ]\>'	contained
  syn match SHmapNewline '|'		contained
  syn case match
  syn keyword SHmapKeys	contained case esac do done for if in then else elif function fi while

  if !exists("b:did_drcstubs_help")
   command -nargs=+ HiLink hi def link <args>
   HiLink SHmapBar 		Delimiter
   HiLink SHmapIgnore	Ignore
   HiLink SHmapInfo		String
   HiLink SHmapNewline	Delimiter
   HiLink SHmapParen	Delimiter
   HiLink SHmapTitle	Statement
   HiLink SHmapKeys		Statement
   HiLink SHmapCursor	Special
   let b:did_drcstubs_help= 1
   delc HiLink
  endif

  norm! 1Gdd
  setlocal ro
  setlocal fdm=marker
  norm! zM
"  call Dret("ShMapHlp")
endfun

" ---------------------------------------------------------------------
"  s:ShMenuToggle: toggle display of menu
augroup DrcShStubsEvents
 au!
 au BufEnter	*	call s:ShMenuToggle(1)
 au BufLeave	*	call s:ShMenuToggle(0)
augroup END
fun! s:ShMenuToggle(menustate)
  if &ft == "sh" && has("gui") && has("gui_running") && has("menu")
"   call Dfunc("s:ShMenuToggle(menustate=".a:menustate.") ft<".&ft.">")
   if a:menustate
    imenu DrChip.ShStubs.Case<tab>ca`	ca`
    imenu DrChip.ShStubs.For<tab>fo`	fo`
    imenu DrChip.ShStubs.If<tab>if`	if`
    imenu DrChip.ShStubs.Else<tab>els`	els`
    imenu DrChip.ShStubs.ElseIf<tab>eli`	eli`
    imenu DrChip.ShStubs.Function<tab>fun`	fun`
    imenu DrChip.ShStubs.While<tab>wh`	wh`
   else
    silent! iunmenu DrChip.ShStubs.Case
    silent! iunmenu DrChip.ShStubs.For
    silent! iunmenu DrChip.ShStubs.If
    silent! iunmenu DrChip.ShStubs.Else
    silent! iunmenu DrChip.ShStubs.ElseIf
    silent! iunmenu DrChip.ShStubs.Function
    silent! iunmenu DrChip.ShStubs.While
   endif
"   call Dret("s:ShMenuToggle")
  endif
endfun

" ---------------------------------------------------------------------
"  vim: fdm=marker
ftplugin/tex/drcstubs.vim	[[[1
630
" drcstubs.vim:
"  Author:  Charles E. Campbell, Jr. (Ph.D.)
"  Date:    Nov 01, 2013
"  Version: 4g	ASTRO-ONLY
"
" Usage: {{{1
"   Double-quotes automatically converted to ``...''
"   Construct expanded upon use of backquote
"   ie.  enum`   ->
"                    \begin{enumerate}
"                     \item <cursor here>
"                    \end{enumerate}
"
"   Both of these kinds of expansions are taken
"   during insert mode.
"
"   This script is designed to work with
"   .vim/indent/tex.vim  indentation-control script.
"
" Environments And Abbreviations: {{{1
"   Short Form  Long Form
"    arr`       array`
"    ctr`       center`
"    desc`      description`
"    desc*`     description*`
"    enum`      enumerate`
"    enum*`     enumerate*`
"    eps`       epsf`       (for insertion of an eps figure)
"    eqn`       equation`
"    eqn*`      equation*`
"    eqna`      eqnarray`
"    eqna*`     eqnarray*`
"    fla`       flalign`
"    fla*`      flalign*`
"    frac`
"    i`                     (creates a \item)
"    ind`       indentation`
"    item`      itemize`
"    item*`     itemize*`
"    mat`       matrix`
"    bmat`      bmatrix`
"    pmat`      pmatrix`
"    smat`      smallmatrix`
"    vmat`      vmatrix`
"    Vmat`      Vmatrix`
"    mini`      minipage`
"    sli`
"    tab`       tabular`
"    fig`       figure`
"    frac`
"    v`                    \verb``
"    verb`      verbatim`
"
" Script Style Support: {{{1
"    bf`                   \textbf{}
"    it`                   \textit{}
"    rm`                   \textrm{}
"    sc`                   \textsc{}
"    sf`                   \textsf{}
"    sl`                   \textsl{}
"    tt`                   \texttt{}
"    mtt`                  \mathtt{}
"    mrm`                  \mathrm{}
"    mbf`                  \mathbf{}
"    msf`                  \mathsf{}
"    mtt`                  \mathtt{}
"    mit`                  \mathit{}
"    mcal`                 \mathcal{}
"
"  Greek Letters: {{{1
"    Short-Form Stands-for        Short-Form Stands-for 
"    ---------- -------------     ---------- ----------
"    a`         \alpha            v          \nu 
"    b`         \beta             f          \xi 
"    g`         \gamma            p          \pi 
"    d`         \delta            vp         \varpi 
"    e`         \epsilon          r          \rho 
"    ve`        \varepsilon       vr         \varrho 
"    z`         \zeta             s          \sigma 
"    n`         \eta              v          \varsigma 
"    t`         \theta            t          \tau 
"    vt`        \vartheta         u          \upsilon 
"    io`        \iota             h          \phi 
"    k`         \kappa            vh         \varphi 
"    l`         \lambda           x          \chi 
"    m`         \mu               q          \psi 
"    w`         \omega 
"
" If none of the above abbreviations immediately precedes the backquote,
" then the backquote will be inserted as is.

" ---------------------------------------------------------------------
" Load Once: {{{1
if exists("b:loaded_drcstubs")
  finish
endif
let b:loaded_drcstubs= "v4g"

" ---------------------------------------------------------------------
" LaTeX settings: {{{1
ino <buffer> <silent> \< \verb`<`
ino <buffer> <silent> \> \verb`>`
ino <buffer> <silent> \~ \verb`~`
ino <buffer> <silent> \" "

" ---------------------------------------------------------------------
" Comment jumping:  (based on idea from Michael Geddes) {{{1
"   ]% : jump to beginning of next     comment block
"   [% : jump to ending    of previous comment block
noremap <buffer> <silent> ]% :call search('^\(\s*%.*\n\)\@<!\(\s*%\)','W')<CR>
noremap <buffer> <silent> [% :call search('\%(^\s*%.*\n\)\%(^\s*%\)\@!','bW')<CR>

" ---------------------------------------------------------------------
" Provides support for [i and [d : {{{1
setlocal include=\\\\input
setlocal define=\\(def\\\\|let\\)
setlocal et

" ---------------------------------------------------------------------
" DrCTexStubs and Quote insertion-maps: {{{1
ino <silent> <buffer> `	<Esc>:call DrCTexStubs()<CR>a
ino <silent> <buffer> " <c-r>=TexQuotes()<cr>

" ---------------------------------------------------------------------
" DrCTexStubs Function: {{{1
fun! DrCTexStubs() "{{{2
"  call Dfunc("DrCTexStubs()")
  setl fdm=manual
"  call Decho("setl fdm=manual")

  exe "norm! a \<esc>h"
  let iskkeep= &isk
  setl isk+=*
  let wrd    = expand("<cword>")
  let vekeep = &ve
  set ve=
  let fdmkeep= &fdm

  " set up init: {{{2
  let init= (col(".") >= col("$")-1)? "diwA"    : "diwi"

  " set up lblline: look for "\ref{...}" in preceding 10 lines  {{{2
  let curline = line(".")
  call SaveWinPosn()
  let lblline = search('\\ref{',"bW")
  if lblline != 0 && lblline > curline-10
   let lblline= substitute(getline("."),'^.*ref{\([-a-zA-Z:][-a-zA-Z0-9]*\)}.*$','\1','e')
   if search('\\label{'.lblline.'}','bw')
    " if \label{lblline} is already in document, then don't repeat it
    let lblline= ""
   endif
  else
   let lblline= ""
  endif
  call RestoreWinPosn()
"  call Decho("lblline<".lblline.">  wrd<".wrd.">")

  " align*`
 if     wrd =~ '\<align\*' " {{{2
   if lblline == ""
    exe "sil! norm! ".init."\\begin{align*}\<CR>\\end{align*}\<Esc>kox\<Esc>x"
   else
    exe "sil! norm! ".init."\\begin{align*}\\label{".lblline."}\<CR>\\end{align*}\<Esc>kox\<Esc>x"
   endif

  " align`
  elseif     wrd =~ '\<align' " {{{2
   if lblline == ""
    exe "sil! norm! ".init."\\begin{align}\<CR>\\end{align}\<Esc>kox\<Esc>x"
   else
    exe "sil! norm! ".init."\\begin{align}\\label{".lblline."}\<CR>\\end{align}\<Esc>kox\<Esc>x"
   endif

  "cases`
  elseif wrd =~ '\<cases'     " {{{2
    exe "sil! norm! ".init."\\begin{cases}\<CR>LEFT&\\text{RIGHT}\<CR>\\end{cases}\<Esc>kFLh\<Esc>"

  " cd` compact description
  elseif wrd =~ '\<cd\%[escription]\*' " {{{2
   exe "sil! norm! bcw\\begin{compactdesc*}\<CR>\\end{compactdesc*}\<Esc>ko\\item[] \<Esc>ba\<Esc>"
   ino <esc> <esc>0f]l:iun <c-v><esc><cr>a

  " cenum` : compact enumerate
  elseif wrd =~ '\<cenum\%[erate]' " {{{2
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\begin{compactenum}\<CR>\\end{compactenum}\<Esc>ko\\item \<Esc>")

  " citem`  : compact itemize
  elseif wrd =~ '\<citem\%[ize]' " {{{2
   exe "sil! norm! ".init."\\begin{compactitem}\<CR>\\end{compactitem}\<Esc>ko\\item \<Esc>"

  " multi`
  elseif wrd =~ '\<multi\%[col]' || wrd =~ '\<multc'   " {{{2
   exe "sil! norm! ".init."\\multicolumn{1}{|c|}{MultiColumn}\<Esc>2F{"

  " multl`
  elseif wrd =~ '\<multl\%[ine]' " {{{2
   if lblline == ""
    exe "sil! norm! ".init."\\begin{multline}\<CR>\\end{multline}\<Esc>kox\<Esc>x"
   else
    exe "sil! norm! ".init."\\begin{multline}\\label{".lblline."}\<CR>\\end{multline}\<Esc>kox\<Esc>x"
   endif

  " split`
  elseif wrd =~ '\<split'   " {{{2
   if lblline == ""
    exe "sil! norm! ".init."\\begin{equation}\\begin{split}\<CR>\\end{split}\\end{equation}\<Esc>kox\<Esc>x"
   else
    exe "sil! norm! ".init."\\begin{equation}\\label{".lblline."}\\begin{split}\<CR>\\end{split}\\end{equation}\<Esc>kox\<Esc>x"
   endif

  " arr*`
  elseif wrd =~ '\<arr\%[ay]\*' " {{{2
   exe "sil! norm! ".init."\<cr>\\left[\\begin{array*}{ccc}\<CR>\\end{array*}\\right]\<esc>0wi \<esc>YP0wDA "

  " beg*`
 elseif wrd =~ '\<beg\%[in]' " {{{2
  exe "sil! norm! ".init."\\begin{X}\<Esc>FXxi"
  ino <esc> <esc>:iun <c-v><esc><cr>Yp0fbcwend<esc>O

  " bmat`
  elseif wrd =~ '\<bmat\%[rix]' " {{{2
   exe "sil! norm! bdwi\\begin{bmatrix}\<CR>X\<CR>\\end{bmatrix}\<Esc>0o\<Esc>?X\<CR>x"

  " Bmat`
  elseif wrd =~ '\<Bmat\%[rix]' " {{{2
   exe "sil! norm! bdwi\\begin{Bmatrix}\<CR>X\<CR>\\end{Bmatrix}\<Esc>0o\<Esc>?X\<CR>x"

  " enum`

  " des*`
  elseif wrd =~ '\<des\%[cription]\*' " {{{2
   exe "sil! norm! bcw\\begin{description*}\<CR>\\end{description*}\<Esc>ko\\item[] \<Esc>ba\<Esc>"
   ino <esc> <esc>0f]l:iun <c-v><esc><cr>a

  " enum*`
  elseif wrd =~ '\<enum\%[erate]\*' " {{{2
   exe "sil! norm! ".init."\\begin{enumerate*}\<CR>\\end{enumerate*}\<Esc>ko\\item \<Esc>"
  elseif wrd =~ '\<enum\%[erate]' " {{{2
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\begin{enumerate}\<CR>\\end{enumerate}\<Esc>ko\\item \<Esc>")

  " epsf`
  elseif wrd =~ '\<epsf\>' " {{{2
   if lblline == ""
    exe "sil! norm! bcw\\begin{figure}[H]\\centering\\framebox{\\epsfbox{X.eps}}\\end{figure}\<Esc>FXcw\<Esc>"
   else
    exe "sil! norm! bcw\\begin{figure}[H]\\label{".lblline."}\\centering\\framebox{\\epsfbox{X.eps}}\\end{figure}\<Esc>FXcw\<Esc>"
   endif

  " epsp`
 elseif wrd =~ '\<epsp\>' " {{{2
  call drcstubs#DrCStubMulti("sil! norm! bcw\\parbox[c]{1.5in}{\\psfrag{&}{&}\\includegraphics[scale=.5]{&.eps}}\<Esc>",
     \ "F&:echo 'Enter fig filename'\<cr>x",
     \ "2F&:echo 'Enter Equation Name'\<cr>x",
     \ "f&:echo 'Enter Equation'\<cr>x",
     \ "/}}\<cr>ll")

  elseif wrd =~ '\<eps\>' " {{{2
   call drcstubs#DrCStubMulti("sil! norm! bcw\\parbox[c]{1.5in}{\\includegraphics[scale=.5]{X.eps}}\<Esc>",
	  \ 'FXx'."\<Esc>:echo 'Enter fig filename'\<cr>",
      \ "/}}\<cr>ll")

  " eqna*`
  elseif wrd =~ '\<eqna\%[rray]\*' || wrd =~ '\<eqna\*' " {{{2
   if lblline == ""
    exe "sil! norm! ".init."\\begin{eqnarray*}\<CR>\\end{eqnarray*}\<Esc>ko & = &  \\\\\<Esc>0f&hh"
   else
    exe "sil! norm! ".init."\\begin{eqnarray*}\\label{".lblline."}\<CR>\\end{eqnarray*}\<Esc>ko & = &  \\\\\<Esc>0f&hh"
   endif
   ino <esc> <esc>02f&l:iun <c-v><esc><cr>a

  " eqna`
  elseif wrd =~ '\<eqna\%[rray]' " {{{2
   if lblline == ""
    exe "sil! norm! ".init."\\begin{eqnarray}\<CR>\\end{eqnarray}\<Esc>ko & = &  \\\\\<Esc>0f&hh"
   else
    exe "sil! norm! ".init."\\begin{eqnarray}\\label{".lblline."}\<CR>\\end{eqnarray}\<Esc>ko & = &  \\\\\<Esc>0f&hh"
   endif
   ino <esc> <esc>02f&l:iun <c-v><esc><cr>a

  " fla*`
  elseif wrd =~ '\<fla\%[lign]\*' " {{{2
   if lblline == ""
    exe "sil! norm! ".init."\\begin{flalign*}\<CR>\\end{flalign*}\<Esc>kox\<Esc>x"
   else
    exe "sil! norm! ".init."\\begin{flalign*}\\label{".lblline."}\<CR>\\end{flalign*}\<Esc>kox\<Esc>x"
   endif

  " frac`
  elseif wrd =~ '\<frac'   " {{{2
   exe "sil! norm! ".init."\\frac{}{}\<Esc>2hi"
   ino <esc> <esc>02f{:iun <c-v><esc><cr>a

  " ind` indentation`
  elseif wrd =~ '\<ind\%[entation]' " {{{2
   exe "sil! norm! ".init."\\begin{indentation}{\\logicindent}{0em} % {left-indent}{right-indent}\<CR>\\end{indentation}\<Esc>kYp0wDA  \<Esc>"

  elseif wrd =~ '\<item\%[ize]\*' " {{{2
   exe "sil! norm! ".init."\\begin{itemize*}\<CR>\\end{itemize*}\<Esc>ko\\item \<Esc>"

   " item` item*`
  elseif wrd =~ '\<item\%[ize]\*' " {{{2
   exe "sil! norm! ".init."\\begin{itemize*}\<CR>\\end{itemize*}\<Esc>ko\\item \<Esc>"
  elseif wrd =~ '\<item\%[ize]' " {{{2
   exe "sil! norm! ".init."\\begin{itemize}\<CR>\\end{itemize}\<Esc>ko\\item \<Esc>"

  " mini`
  elseif wrd =~ '\<mini\%[page]' " {{{2
   exe "sil! norm! bdwi\\begin{minipage}[H]{Xin}\<CR>\\end{minipage}\<Esc>?X\<cr>xi"
   ino <esc> <esc>:iun <c-v><esc><cr>o

  " pmat`
  elseif wrd =~ '\<pmat\%[rix]' " {{{2
   exe "sil! norm! bdwi\\begin{pmatrix}\<CR>X\<CR>\\end{pmatrix}\<Esc>0o\<Esc>?X\<CR>x"

  " ptab`
  elseif wrd =~ '\<ptab\%[ular]' " {{{2
   if lblline == ""
	exe "sil! norm! bcw\\begin{center}\\begin{tabular}{X}\<CR>\\end{tabular}\\end{center}\<CR>\<esc>"
   else
	exe "sil! norm! bcw\\begin{center}\\begin{tabular}{X}\\label{".lblline."}\<CR>\\end{tabular}\\end{center}\<CR>\<esc>"
   endif
   exe "sil! norm! kk0fXxi"
   ino <esc> <esc>:iun <c-v><esc><cr>o

  " smat`
  elseif wrd =~ '\<smat' || wrd =~ '\<smallmatrix'  " {{{2
   exe "sil! norm! bdwa\\left[\\begin{smallmatrix}X\\end{smallmatrix}\\right]\<Esc>?X\<CR>xh"

  " verb`
  elseif wrd =~ '\<verb\%[atim]'   " {{{2
   exe "sil! norm! bdwi\\begin{verbatim}\<CR>\<c-u>\\end{verbatim}\<Esc>kA\<cr>\<c-u>"

  " vmat`
  elseif wrd =~ '\<vmat\%[rix]' " {{{2
   exe "sil! norm! bdwi\\begin{vmatrix}\<CR>X\<CR>\\end{vmatrix}\<Esc>0o\<Esc>?X\<CR>x"

  " Vmat`
  elseif wrd =~ '\<Vmat\%[rix]' " {{{2
   exe "sil! norm! bdwi\\begin{Vmatrix}\<CR>X\<CR>\\end{Vmatrix}\<Esc>0o\<Esc>?X\<CR>x"

  " arr`
  elseif wrd =~ '\<arr\%[ay]' " {{{2
   exe "sil! norm! ".init."\<cr>\\left[\\begin{array}{ccc}\<CR>\\end{array}\\right]\<esc>0wi \<esc>YP0wDA "

  " cen`
  elseif wrd =~ '\<cen\%[ter]' || wrd =~ '\<ctr'   " {{{2
   exe "sil! norm! ".init."\\begin{center}\<CR>\\end{center}\<Esc>ko\<Esc>"

  " des`
  elseif wrd =~ '\<des\%[cription]' " {{{2
   exe "sil! norm! bcw\\begin{description}\<CR>\\end{description}\<Esc>ko\\item[] \<Esc>ba\<Esc>"
   ino <esc> <esc>0f]l:iun <c-v><esc><cr>a

  " fig`
  elseif wrd =~ '\<fig\%[ure]' " {{{2
   if lblline == ""
    exe "sil! norm! bcw\\begin{figure}[H]\\centering\<CR> \\framebox{X}\<CR> \\caption{CAPTION HERE}\<CR> \\end{figure}\<Esc>0kkfXcw\<Esc>"
   else
    exe "sil! norm! bcw\\begin{figure}[H]\\label{".lblline."}\\centering\<CR> \\framebox{X}\<CR> \\caption{CAPTION HERE}\<CR> \\end{figure}\<Esc>0kkfXcw\<Esc>"
   endif

  " fla`
  elseif wrd =~ '\<fla\%[lign]' " {{{2
   if lblline == ""
    exe "sil! norm! ".init."\\begin{flalign}\<CR>\\end{flalign}\<Esc>kox\<Esc>x"
   else
    exe "sil! norm! ".init."\\begin{flalign}\\label{".lblline."}\<CR>\\end{flalign}\<Esc>kox\<Esc>x"
   endif

  " gat`
  elseif wrd =~ '\<gat\%[her]' " {{{2
   if lblline == ""
    exe "sil! norm! ".init."\\begin{gather}\<CR>\\end{gather}\<Esc>kox\<Esc>x"
   else
    exe "sil! norm! ".init."\\begin{gather}\\label{".lblline."}\<CR>\\end{gather}\<Esc>kox\<Esc>x"
   endif

  " ind`
  elseif wrd =~ '\<ind\%[ent]'   " {{{2
   exe "sil! norm! ".init."\\begin{indentation}{\\logicindent}{0em}\<CR>\\end{indentation}\<Esc>ko\<Esc>x"

  " lst`
  elseif wrd =~ '\<lst\%[listing]'	" {{{2
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\begin{lstlisting}\<CR>\\end{lstlisting}\<Esc>ko \<Esc>x")

  " mat`
  elseif wrd =~ '\<mat\%[rix]' " {{{2
   exe "sil! norm! bdwi\\left[\\begin{matrix}\<CR>X\<CR>\\end{matrix}\\right]\<Esc>0o\<Esc>?X\<CR>x"

   " nst[tabbing]`
  elseif wrd =~ '\<nst\%[abbing]' " {{{2
   exe "sil! norm! bcw\\begin{nstabbing}\<CR>X\<CR>\\end{nstabbing}\<esc>?X\<CR>x"

  " sli`
  elseif wrd =~ '\<sli\%[de]' " {{{2
   exe "sil! norm! bcw\\begin{slide}{X} % \{\{\{2 \<CR>\\end{slide}\<esc>k0fXxi"
   ino <esc> <esc>:iun <c-v><esc><cr>o

  " tabb[ing]`
  elseif wrd =~ '\<tabb\%[ing]' " {{{2
   exe "sil! norm! bcw\\begin{tabbing}\<CR>X\<CR>\\end{tabbing}\<esc>?X\<CR>x"

  " tab`
  elseif wrd =~ '\<tab\%[ular]' " {{{2
   exe "sil! norm! bdw\<Esc>"
   if lblline == ""
    exe "sil! norm! o\\begin{table}[H]\<CR>\\begin{center}\\begin{tabular}{||l|l|l||}\<CR>\\hline\\hline\<CR>\\multicolumn{1}{||c|}{Column 1} &\<CR>\\multicolumn{1}{c|}{Column 2}   &\<CR>\\multicolumn{1}{c||}{Column 3}  \\\\\<CR>\\hline\<CR>  ...&...&...\\\\\<CR>\<BS>\<BS>\\hline\\hline\<CR>\<BS>\\end{tabular}\\end{center}\<CR>\\caption{Table Name}\<CR>\\end{table}\<CR>\<ESC>"
   else
    exe "sil! norm! o\\begin{table}[H]\\label{".lblline."}\<CR>\\begin{center}\\begin{tabular}{||l|l|l||}\<CR>\\hline\\hline\<CR>\\multicolumn{1}{||c|}{Column 1} &\<CR>\\multicolumn{1}{c|}{Column 2}   &\<CR>\\multicolumn{1}{c||}{Column 3}  \\\\\<CR>\\hline\<CR>  ...&...&...\\\\\<CR>\<BS>\<BS>\\hline\\hline\<CR>\<BS>\\end{tabular}\\end{center}\<CR>\\caption{Table Name}\<CR>\\end{table}\<CR>\<ESC>"
   endif
   exe "sil! norm! ?begin{tabular}?\<CR>fl;h"

  " eq*`  eqn*`
  elseif wrd =~ 'eq\%[uation]\*' || wrd =~ '\<eq\*' || wrd =~ '\<eqn\*' " {{{2
   if lblline == ""
    exe "sil! norm! ".init."\\begin{equation*}\<CR>\\end{equation*}\<Esc>kox\<Esc>x"
   else
    exe "sil! norm! ".init."\\begin{equation*}\\label{".lblline."}\<CR>\\end{equation*}\<Esc>kox\<Esc>x"
   endif

   " eq`  eqn`
  elseif wrd =~ 'eq\%[uation]' || wrd =~ '\<eqn'   " {{{2
   if lblline == ""
    exe "sil! norm! ".init."\\begin{equation}\<CR>\\end{equation}\<Esc>kox\<Esc>x"
   else
    exe "sil! norm! ".init."\\begin{equation}\\label{".lblline."}\<CR>\\end{equation}\<Esc>kox\<Esc>x"
   endif

  " i`
  elseif wrd =~ '\<i\>'   " {{{2
   if v:version >= 700
   	let swp = SaveWinPosn()
	let bgn = 1
	let end = 1
	while bgn <= end && bgn > 0 && end > 0
	 let end= search('\\end\s*{\s*\%(itemize\|description\|enumerate\)\s*}','bnW')
	 let bgn= search('\\begin\s*{\s*\%(itemize\|description\|enumerate\)\s*}','bW')
	endwhile
	call RestoreWinPosn(swp)
	if getline(bgn) =~ "description"
     exe "sil! norm! ".init."\\item[] \<Esc>hha"
     ino <esc> <esc>0f]l:iun <c-v><esc><cr>a
	else
     exe "sil! norm! ".init."\\item "
	endif
   else
    exe "sil! norm! ".init."\\item "
   endif

  " gc` : green comment
  elseif wrd =~ '\<gc\>'   " {{{2
   call drcstubs#DrCStubMulti('sil! norm! bcw\textcolor{green}{\textbf{&}}',"F&:echo 'Enter comment'\<cr>x","/}}\<cr>ll")

  " g` : gray75 text
  elseif wrd =~ '\<Gc'     " {{{2
   call drcstubs#DrCStubMulti('sil! norm! xi\textcolor{gray75}{\textsf{\footnotesize &}}',"F&:echo 'Enter text'\<cr>x","/}}\<cr>ll")

  " v`
  elseif wrd =~ '\<v'      " {{{2
   call drcstubs#DrCStubMulti('sil! norm! xi\verb`&`',"F&:echo 'Enter text'\<cr>x","/`\<cr>l")

  " V`
  elseif wrd =~ '\<V'      " {{{2
   call drcstubs#DrCStubMulti('sil! norm! xi\Verbatim`&`',"F&:echo 'Enter text'\<cr>x","/`\<cr>l")

  " LaTeX script support   " {{{2
  " bf`
  elseif wrd =~ '\<bf'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\textbf{&}\<esc>","F&:echo 'Enter bold text'\<cr>x","/}\<cr>l")
   " it`
  elseif wrd =~ '\<it'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\textit{&}\<esc>","F&:echo 'Enter italic text'\<cr>x","/}\<cr>l")
   " rm`
  elseif wrd =~ '\<rm'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\textrm{&}\<esc>","F&:echo 'Enter roman text'\<cr>x","/}\<cr>l")
   " sc`
  elseif wrd =~ '\<sc'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\textsc{&}\<esc>","F&:echo 'Enter slanted capital text'\<cr>x","/}\<cr>l")
   " sf`
  elseif wrd =~ '\<sf'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\textsf{&}\<esc>","F&:echo 'Enter sans-serif text'\<cr>x","/}\<cr>l")
   " sl`
  elseif wrd =~ '\<sl'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\textsl{&}\<esc>","F&:echo 'Enter slanted text'\<cr>x","/}\<cr>l")
   " tt`
  elseif wrd =~ '\<tt'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\texttt{&}\<esc>","F&:echo 'Enter typewriter text'\<cr>x","/}\<cr>l")
   " mcal`
  elseif wrd =~ '\<mcal'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\mathcal{&}\<esc>","F&:echo 'Enter calligraphic text'\<cr>x","/}\<cr>l")
   " mbf`
  elseif wrd =~ '\<mbf'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\mathbf{&}\<esc>","F&:echo 'Enter math-bold text'\<cr>x","/}\<cr>l")
   " mit`
  elseif wrd =~ '\<mit'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\mathit{&}\<esc>","F&:echo 'Enter math-italic text'\<cr>x","/}\<cr>l")
   " mrm`
  elseif wrd =~ '\<mrm'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\mathbf{&}\<esc>","F&:echo 'Enter math-roman text'\<cr>x","/}\<cr>l")
   " msf`
  elseif wrd =~ '\<msf'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\mathsf{&}\<esc>","F&:echo 'Enter math-slanted text'\<cr>x","/}\<cr>l")
   " mtt`
  elseif wrd =~ '\<mtt'
   call drcstubs#DrCStubMulti("sil! norm! ".init."\\mathtt{&}\<esc>","F&:echo 'Enter math-typewriter text'\<cr>x","/}\<cr>l")

  " Lower case Greek alphabet   " {{{2
   " a`
  elseif wrd =~ '\<a\>'
   exe "sil! norm! r\\aalpha\<Esc>a"
   " b`
  elseif wrd =~ '\<b\>'
   exe "sil! norm! r\\abeta\<Esc>a"
   " g`
  elseif wrd =~ '\<g\>'
   exe "sil! norm! r\\agamma\<Esc>a"
   " d`
  elseif wrd =~ '\<d\>'
   exe "sil! norm! r\\adelta\<Esc>a"
   " e`
  elseif wrd =~ '\<e\>'
   exe "sil! norm! r\\aepsilon\<Esc>a"
   " ve`
  elseif wrd =~ '\<ve\>'
   exe "sil! norm! ".init."\\varepsilon"
   " z`
  elseif wrd =~ '\<z\>'
   exe "sil! norm! r\\azeta\<Esc>a"
   " n`
  elseif wrd =~ '\<n\>'
   exe "sil! norm! r\\aeta\<Esc>a"
   " t`
  elseif wrd =~ '\<t\>'
   exe "sil! norm! r\\atheta\<Esc>a"
   " vt`
  elseif wrd =~ '\<vt\>'
   exe "sil! norm! ".init."\\vartheta"
   " io`
  elseif wrd =~ '\<io\>'
   exe "sil! norm! ".init."\\iota"
   " k`
  elseif wrd =~ '\<k\>'
   exe "sil! norm! r\\akappa\<Esc>a"
   " l`
  elseif wrd =~ '\<l\>'
   exe "sil! norm! r\\alambda\<Esc>a"
   " m`
  elseif wrd =~ '\<m\>'
   exe "sil! norm! r\\amu\<Esc>a"
   " vv`
  elseif wrd =~ '\<vv\>'
   exe "sil! norm! r\\anu\<Esc>a"
   " p`
  elseif wrd =~ '\<p\>'
   exe "sil! norm! r\\api\<Esc>a"
   " vp`
  elseif wrd =~ '\<vp\>'
   exe "sil! norm! ".init."\\varpi"
   " r`
  elseif wrd =~ '\<r\>'
   exe "sil! norm! r\\arho\<Esc>a"
   " vr`
  elseif wrd =~ '\<vr\>'
   exe "sil! norm! ".init."\\varrho"
   " vt`
  elseif wrd =~ '\<vt\>'
   exe "sil! norm! ".init."\\vartheta"
   " s`
  elseif wrd =~ '\<s\>'
   exe "sil! norm! r\\asigma\<Esc>a"
   " vs`
  elseif wrd =~ '\<vs\>'
   exe "sil! norm! r\\avarsigma\<Esc>a"
   " tau`
  elseif wrd =~ '\<tau\>'
   exe "sil! norm! r\\atau\<Esc>a"
   " u`
  elseif wrd =~ '\<u\>'
   exe "sil! norm! r\\aupsilon\<Esc>a"
   " h`
  elseif wrd =~ '\<h\>'
   exe "sil! norm! r\\aphi\<Esc>a"
   " vh`
  elseif wrd =~ '\<vh\>'
   exe "sil! norm! ".init."\\varphi"
   " x`
  elseif wrd =~ '\<x\>'
   exe "sil! norm! r\\achi\<Esc>a"
   " q`
  elseif wrd =~ '\<q\>'
   exe "sil! norm! r\\apsi\<Esc>a"
   " w`
  elseif wrd =~ '\<w\>'
   exe "sil! norm! r\\aomega\<Esc>a"

  else
   exe "sil! norm! a`\<Esc>"
  endif

  let &ve  = vekeep
  let &isk = iskkeep
  let &fdm = fdmkeep
"  call Decho("restored fdm=".fdmkeep)
"  call Dret("DrCTexStubs")
endfun

" ---------------------------------------------------------------------
" TexQuotes: converts a '"' into `` or '' in LaTeX. {{{1
"            Supports an imap
fun! TexQuotes()
  let line   = getline(".")
  let curpos = col(".")-1
  let insert = "''"
  let left   = strpart(line, curpos-1, 1)
  let tzid   = synIDtrans(hlID("texZone"))
  let curcol = col(".") - 1

  if tzid == synIDtrans(synID(line("."),curcol,1))
   let insert= '"'
  elseif left == "\\"
    exe "norm! hr\"i\"\<Esc>l"
    let insert = ''
  elseif left == ' ' || left == '	' || left == ''
    let insert = '``'
    endif
  return insert
endfun

" ---------------------------------------------------------------------
"  vim:fdm=marker
ftplugin/vim/drcstubs.vim	[[[1
231
" drcstubs.vim: Dr Chip's Vim Stubs  (a plugin)
"
"  Author:  Charles E. Campbell, Jr. (PhD)
"  Date:    Jun 29, 2009
"  Version: 3
"
"  Usage:  (requires 6.0 or later)
"
"   These maps all work during insert mode while editing vim
"   scripts.  Use either the shorthand or longhand maps
"   below, and the associated construct will be expanded to
"   include parentheses, curly braces, and the cursor will be
"   moved to a convenient location, still in insert mode, for
"   further editing.
"
"   Shorthand  Longhand
"   Map        Map
"   ---------  --------
"   i`         if`
"   e`         els[e]`
"   ei`        elsei[f]`
"   w`         wh[ile]`
"   fu`        fu[nction]`
"   F`         Dfunc`
"   R`         Dret`
"   D`         Decho`
"
"   Caveat: these maps will not work if "set paste" is on
"
" Installation:
"
" This copy of DrC's Vim-Stubs is filetype plugin for vim 6.0: put it in
"  ${HOME}/.vim/ftplugin/vim/
" (or make suitable links) and put "filetype plugin on" in your <.vimrc>.
"
" "Grace, mercy, and peace from God the Father and the Lord Jesus Christ
" our Savior" Titus 1:4b
" =======================================================================

" Load Once: {{{1
if exists("b:loaded_drcstubs")
  finish
endif
let b:loaded_drcstubs= "v3"

" ---------------------------------------------------------------------
" Special Syntax: {{{1
syn keyword vimTodo COMBAK
syn match vimTodo "^[- ]*COMBAK[- ]*$" 

" ---------------------------------------------------------------------
" Public Interface: {{{1

" backquote calls DrChipVimStubs function
if !hasmapto('<Plug>UseDrCStubs')
 imap <buffer> <unique> ` <Plug>UseDrCVimStubs
endif
inoremap <Plug>UseDrCVimStubs <Esc>:call <SID>DrCVimStubs()<CR>a

" provide help for drcstubs
com! Drcstubs call s:Vimhlp()

" ---------------------------------------------------------------------

" DrCVimStubs: this function changes the backquote into {{{1
"              text based on what the preceding word was
fun! <SID>DrCVimStubs()
 let vekeep= &ve
 set ve=

 let wrd=expand("<cWORD>")

 if     wrd =~ '\<if\>'
  exe "norm! bdWaif \<CR>endif\<Esc>k$"
 elseif wrd =~ '\<i\>'
  exe "norm! xaif \<CR>endif\<Esc>k$"

 elseif wrd =~ '\<els\%[e]\>'
  exe "norm! bdWaelse\<CR>\<Esc>O \<c-h>\<Esc>"
 elseif wrd =~ '\<e\>'
  exe "norm! xaelse \<CR>\<Esc>O \<c-h>\<Esc>"

 elseif wrd =~ '\<el\%[seif]\>'
  exe "norm! bdWaelseif \<CR>\<Esc>k$"
 elseif wrd =~ '\<ei\>'
  exe "norm! bdWaelseif \<CR>\<Esc>k$"

 elseif wrd =~ '\<fu\%[nction]\>'
  exe "norm! bdW"
  r $STUB/stubfunc.vim
  let fname= input("Enter function name: ")
  exe '/Function:/,/endfun/s/Function/'.fname.'/'
  call search('^\s*fun!','bW')
  ino <esc> <esc>:iun <c-v><esc><cr>/)$<cr>jo
  norm! f(a

 elseif wrd =~ '\<wh\%[ile]\>'
  exe "norm! bdWawhile \<CR>endwhile\<Esc>k$"
 elseif wrd =~ '\<w\>'
  exe "norm! xawhile \<CR>endwhile\<Esc>k$"

 elseif wrd =~ '\<Df\%[unc]\>'
  exe "norm! bdWacall Dfunc(\"()\")\<Esc>4hma?^\\s*fu\\%[nction]?\\>\<cr>WdwP`apla"
  ino <esc> <esc>:iun <c-v><esc><cr>/)$<cr>o
 elseif wrd =~ '\<F\>'
  exe "norm! xacall Dfunc(\"()\")\<Esc>4hma?^\\s*fu\\%[nction]?\\>\<cr>WdwP`apla"
  ino <esc> <esc>:iun <c-v><esc><cr>/)$<cr>o

 elseif wrd =~ '\<Dr\%[et]\>'
  exe "norm! bdWacall Dret(\"return \")\<Esc>2hma?^\\s*fu\\%[nction]?\\>\<cr>WdwP`apa"
  ino <esc> <esc>:iun <c-v><esc><cr>/)$<cr>
 elseif wrd =~ '\<R\>'
  exe "norm! xacall Dret(\"return \")\<Esc>2hma?^\\s*fu\\%[nction]?\\>\<cr>WdwP`apa"
  ino <esc> <esc>:iun <c-v><esc><cr>/)$<cr>

 elseif wrd =~ '\<De\%[cho]\>'
  exe "norm! bdWacall Decho(\"\")\<Esc>2hma"
  ino <esc> <esc>:iun <c-v><esc><cr>/)$<cr>o
 elseif wrd =~ '\<D\>'
  exe "norm! xacall Decho(\"\")\<Esc>2hma"
  ino <esc> <esc>:iun <c-v><esc><cr>/)$<cr>o

 else
  exe "norm! a`\<Esc>"
 endif

 let &ve= vekeep
endfun

" ---------------------------------------------------------------------
" Vimhlp: sets up a special window holding a list of my Vim-related {{{1
" maps, imaps, etc
fun! s:Vimhlp()
"  call Dfunc("Vimhlp()")

  " create VimHelp window
  if !exists("s:vimhelpbuf") || !bufexists(s:vimhelpbuf)
   let isfkeep= &isfname
   set isfname-=[
   set isfname-=]
   exe "bo sp ".escape('[Vim Map and Command Help]','')
   set buftype=nofile
   set bufhidden=wipe
   set noswapfile
   set noro
   let &isfname     = isfkeep
   let s:vimhelpbuf = bufnr("%")
  endif

  put ='Imaps'
  put ='_Longhand     Shorthand 	Expands To_'
  put =' --------     --------- 	----------'
  put ='  if           i        	 if X\|endif'
  put ='  els[e]       e        	 else\|X'
  put ='  elsei[f]     ei       	 elseif X'
  put ='  fu[nction]            	 fun! X(Y)\|endfun'
  put ='  wh[ile]      w        	 while X\|endwhile'
  put ='  Df[unc]      F        	 call Dfunc(\"func(X)\")\|Y'
  put ='  Dr[et]       R        	 call Dret(\"return func X\")'
  put ='  De[cho]      D        	 call Decho(\"X\")\|Y'

  " syntax highlighting
  syn match VmapBar		'---\+'
  syn match VmapInfo	'([^)]\+)'	contains=VmapParen
  syn match VmapTitle	'^.*{{{\d$'	contains=VmapIgnore
  syn match VmapTitle	'_.\{-}_'	contains=VmapIgnore
  syn match VmapIgnore	'{{{\d'		contained
  syn match VmapIgnore	'_'			contained
  syn match VmapParen	'[{}()]'	contained
  syn match VmapExpansion '\t .*$'	contains=VmapKeys,VmapParen,VmapCursor,VmapNewline
  syn match VmapCursor	'\<[XY]\>'	contained
  syn match VmapNewline '|'			contained
  syn case match
  syn keyword VmapKeys	contained if else elseif fun endfun endif endwhile while Dfunc Dret Decho call

  if !exists("b:did_drcstubs_help")
   command -nargs=+ HiLink hi def link <args>
   HiLink VmapBar 		Delimiter
   HiLink VmapIgnore	Ignore
   HiLink VmapInfo		String
   HiLink VmapNewline	Delimiter
   HiLink VmapParen		Delimiter
   HiLink VmapTitle		Statement
   HiLink VmapKeys		Statement
   HiLink VmapCursor	Special
   let b:did_drcstubs_help= 1
   delc HiLink
  endif

  norm! 1Gdd
  setlocal ro
  setlocal fdm=marker
  norm! zM
"  call Dret("Vimhlp")
endfun

" ---------------------------------------------------------------------
"  s:VimMenuToggle: toggle display of menu
augroup DrcVimStubsEvents
 au!
 au BufEnter	*	call s:VimMenuToggle(1)
 au BufLeave	*	call s:VimMenuToggle(0)
augroup END
fun! s:VimMenuToggle(menustate)
  if &ft == "vim" && has("gui") && has("gui_running") && has("menu")
"   call Dfunc("s:VimMenuToggle(menustate=".a:menustate.") ft<".&ft."> mode<".mode().">")
   if a:menustate
	imenu DrChip.VimStubs.Decho<tab>Decho`	De`
	imenu DrChip.VimStubs.Dfunc<tab>Dfunc`	F`
	imenu DrChip.VimStubs.Dret<tab>Dret`	R`
	imenu DrChip.VimStubs.ElseIf<tab>elseif`	elsei`
	imenu DrChip.VimStubs.Else<tab>else`	e`
	imenu DrChip.VimStubs.Function<tab>fun`	fun`
    imenu DrChip.VimStubs.If<tab>if`		i`
	imenu DrChip.VimStubs.While<tab>while`	wh`
   else
	silent! iunmenu DrChip.VimStubs.Decho
	silent! iunmenu DrChip.VimStubs.Dfunc
	silent! iunmenu DrChip.VimStubs.Dret
	silent! iunmenu DrChip.VimStubs.ElseIf
	silent! iunmenu DrChip.VimStubs.Else
	silent! iunmenu DrChip.VimStubs.Function
	silent! iunmenu DrChip.VimStubs.If
	silent! iunmenu DrChip.VimStubs.While
   endif
"   call Dret("s:VimMenuToggle")
  endif
endfun

" ---------------------------------------------------------------------
"  vim: fdm=marker
doc/drcstubs.txt	[[[1
222
*drcstubs.txt*	DrChip's C Stubs						Apr 03, 2013

Author:  Charles E. Campbell  <NdrOchip@ScampbellPfamily.AbizM>
	  (remove NOSPAM from Campbell's email first)
Copyright: (c) 2004-2013 by Charles E. Campbell		*drcstubs-copyright*
           The VIM LICENSE applies to drcstubs.vim and drcstubs.txt
           (see |copyright|) except use "drcstubs" instead of "Vim"
	   No warranty, express or implied.  Use At-Your-Own-Risk.

==============================================================================
1. Contents					*drcstubs* *drcstubs-contents*

   1. Contents.............................: |drcstubs-contents|
   2. Usage................................: |drcstubs-usage|
	  C Language Support...................: |drcstubs-c|
	  LaTeX Language Support...............: |drcstubs-tex|
	  Vim Language Support.................: |drcstubs-vim|
   3. Installation.........................: |drcstubs-install|
   4. History..............................: |drcstubs-history|


==============================================================================
2. Usage						*drcstubs-usage*

   All of the DrCStubs ftplugin scripts provide maps which work during insert
   mode.  One may use either the shorthand or longhand maps to invoke the
   corresponding imap.  They are invoked whenever a string is followed by
   a backquote.

   One major advantage of these imaps is that they, in turn, take advantage of
   the user's cindent settings and/or indentation scripts.  Thus the result
   should be as if the user had typed them him/herself.

   These imaps will not operate if "set paste:" is on.

   In the maps below:

	An "X" is where the cursor will end up after the map is invoked.
	An "Y" is where the cursor will end up after an <esc> is pressed.
	An "Z" is where the cursor will end up after an <esc> is pressed twice.
	A  "|" means a newline.

   Another form of help is available by typing >

   	:Drcstubs
<

   ------------------
   C LANGUAGE SUPPORT									*drcstubs-c*
   ------------------
>
		Shorthand    Longhand     Expands
		Map          Map          To
		---------    --------     -------
<		i`           if`          if(X) {Y}
		e`           els[e]`      else {X}
		ei`          eli[f]`      else if(X) {Y}
		er`                       if(xmerror)(*xmerror)(XTDIO_WARNING,"(X) Y\n");
		f`           for\=`       for(X;;) {Y}
		w`           wh[ile]`     while(X) {Y}
		s`           sw[itch]`    switch(X) {Y}
		c`           ca[se]`      case X: Y break;
		d`           defa[ult]`   default: Y break;
		`            do`          do {X} while(Y);
		E`           Ed[bg]`      Edbg((\"func(X)\"Y));
		R`           Rd[bg]`      Rdbg((\"funcX\"Y));
		D`           Dp[rintf]`   Dprintf((1,\"X\"Y));
		             in[clude]`   #include X
		             de[fine]`    #define X
		             #`           #ifdef X ... #endif

   -------------
   LATEX SUPPORT				*drcstubs-tex* *drcstubs-latex*
   -------------
>
		  Environments And Abbreviations
		Shorthand    Longhand     Expands
		Map          Map          To
<		---------    --------     -------
		align`                    \begin{align}|X|\end{align}
		arr`         array`       \left[\begin{array}{ccc}|X|\end{array}\right]
		ctr`         center`      \begin{center}|X|\end{center}
		desc`        description` \begin{description}\item[|X|]\end{sdescription}
		enum`        enumerate`   \begin{enumerate}|\item X|\end{enumerate}
		eps`         epsf`        \begin{figure}[H]\centering\framebox{\epsfbox{X.eps}}\end{figure}
		eqn`         equation`    \begin{equation}|X|\end{equation}
		eqn*`        equation*`   \begin{equation*}|X|\end{equation*}
		eqna`        eqnarray`    \begin{eqnarray}|X&=& Y \\|\end{eqnarray}
		eqna*`       eqnarray*`   \begin{eqnarray*}|X&=& Y \\|\end{eqnarray*}
		fig`         figure`      \begin{figure}[H]\centering \framebox{X} \caption{CAPTION HERE} \end{figure}
		flalign`     fla`         \begin{flalign}|X|\end{flalign}
		flalign*`    fla*`        \begin{flalign*}|X|\end{flalign*}
		frac`                     \frac{X}{Y}
		gat`         gather`      \begin{gather}|X|\end{gather}
		i`                        \item |X|
		i`                        \item[|X|] |Y|        (if vim v7, and in a description block)
		item`        itemize`     \begin{itemize}|\item X|\end{itemize}
		mat`         matrix`      \left[\begin{array}{cc} |X| &   & \\|&   & \end{array}\right]
		mini`        minipage`    \begin{minipage}[H]{4in}|X|\end{minipage}
		multc`       multicol`    \multicolumn{1}{|X|}{MultiColumn}
		multl`       multline`    \begin{multline}|X|\end{multline}
		split`                    \begin{equation}\begin{split}|X|\end{split}\end{equation}
		tab`         tabular`     (too long for here)
		ptab`        ptabular`    \begin{center}\begin{tabular}{|X|}\end{tabular}\end{center}
		v`                        \verb`|X|`
		verb`        verbatim`    \begin{verbatim}|X|\end{verbatim}
>
			Script Style Support
		Shorthand    Longhand     Expands
		Map          Map          To
<		---------    --------     -------
		bf`                       \textbf{}
		it`                       \textit{}
		rm`                       \textrm{}
		sc`                       \textsc{}
		sf`                       \textsf{}
		sl`                       \textsl{}
		tt`                       \texttt{}
		mtt`                      \mathtt{}
		mrm`                      \mathrm{}
		mbf`                      \mathbf{}
		msf`                      \mathsf{}
		mtt`                      \mathtt{}
		mit`                      \mathit{}
		mcal`                     \mathcal{}
>
					Greek Letters:
		Shorthand    Expands		Shorthand    Expands
		Map          To     		Map          To
<		---------    -------		---------    -------
		a`           \alpha        v             \nu
		b`           \beta         f             \xi
		g`           \gamma        p             \pi
		d`           \delta        vp            \varpi
		e`           \epsilon      r             \rho
		ve`          \varepsilon   vr            \varrho
		z`           \zeta         s             \sigma
		n`           \eta          v             \varsigma
		t`           \theta        t             \tau
		vt`          \vartheta     u             \upsilon
		io`          \iota         h             \phi
		k`           \kappa        vh            \varphi
		l`           \lambda       x             \chi
		m`           \mu           q             \psi
		w`           \omega


   ----------
   SH SUPPORT												*drcstubs-sh*
   ----------
>
		Shorthand    Longhand     Expands
		Map          Map          To
<		---------    --------     -------
		ca[se]`      c`           case X in Y esac
		fo[r]`       f`           for X in Y ; do Z done
		if`          i`           if [[X]]; thenYfi
		eli[f]`      ei`          elif [[X]]; then Y
		els[e]`      e`           else X
		fu[nction]`               function X { Y }
		wh[ile]`     w`           while [[ X ]]; do Y done


   -----------
   VIM SUPPORT												*drcstubs-vim*
   -----------
>
		Shorthand    Longhand     Expands
		Map          Map          To
<		---------    --------     -------
		i            if           if |X|| endif
		e            els[e]       else |X|
		ei           eli[f]       elseif |X|
		             fu[nction]   fun! |X| ( |Y| ) endfun
		w            wh[ile]      while |X| endwhile
		F            Df[unc]      call Dfunc("func(|X|)")|Y|
		R            Dr[et]       call Dret("return func |X|")
		D            De[echo]     call Decho("|X|")|Y|

==============================================================================
3. Installation						*drcstubs-install*

	a) place drcstubs.tar.gz in your
		Unix: $HOME/.vim
		Windows: ..wherever..\vimfiles
	   directory

	b) gunzip drcstubs.tar.gz

	c) tar -oxvf drcstubs.tar

	d) Unix:
		vim
		:helptags ~/.vim/doc
	   Windows:
		vim
		:helptags ..wherever../vimfiles/doc
	
	e) Have a line in your <.vimrc> file such as:
		filetype plugin indent on

	The next time you bring up vim with one of the supported filetypes
	(C, C++, LaTeX, Vim, sh-ksh-bash) the Drcstubs maps will be available
	for use.  They work best if you've set up cindent (see |'cinoptions'|);
	the one I use follows, but may well not be the style to which you are
	accustomed:

	set cino=>s,e0,n0,f0,{0,}4,^-1s,:0,=s,g0,h1s,p2,t0,+2,(2,)20,*30

	You'll also want automatic indentation.  Vim comes with several such
	scripts; the ones I've customized are available at

	http://vim.sourceforge.net/scripts/script.php?script_id=1270

==============================================================================
4. History						*drcstubs-history*

	4	Sep 12, 2011	: added some *-versions (eqn*, eqna*, fla*, etc)
	3	Jun 29, 2009	: put silent! on iunmenu calls to prevent unwanted
						  error messages when inappropriately invoked.

vim: ts=4
